import type { AxiosRequestConfig, AxiosResponse } from 'axios'

// 针对AxiosRequestConfig进行扩展
export interface IPKInterceptors<T = AxiosResponse> {
  requestOnFulfilledFn?: (config: AxiosRequestConfig) => AxiosRequestConfig
  requestOnRejectedFn?: (err: any) => any
  responseOnFulfilledFn?: (res: T) => T
  responseOnRejectedFn?: (err: any) => any
}

export interface PKRequestConfig<T = AxiosResponse> extends AxiosRequestConfig {
  interceptors?: IPKInterceptors<T>
}
